<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Bootstrap Paginator V3 Tests</title>
    <link rel="stylesheet" href="bootstrapv3.css">
    <script src="jquery-1.9.1.min.js" type="text/javascript"></script>
	<script src="bootstrapv3.js"></script>
</head>
<body>

<div>
    <ul id='bp-3-element-test' 	style="cursor:hand;"></ul>
</div>

<script src="bootstrap-paginator.js"></script>

<script type="text/javascript">

    $(function(){
        	var element = $('#bp-3-element-test');//获得数据装配的位置
        	//初始化所需数据
        var options = {
            bootstrapMajorVersion:3,//版本号。3代表的是第三版本
            currentPage: 2, //当前页数
            numberOfPages: 5, //显示页码数标个数
            totalPages:21, //总共的数据所需要的总页数
            itemTexts: function (type, page, current) {  
            		//图标的更改显示可以在这里修改。
            switch (type) {  
                    case "first":  
                        return "<<";  
                    case "prev":  
                        return "<";  
                    case "next":  
                        return ">";  
                    case "last":  
                        return ">>";  
                    case "page":  
                        return  page;  
                }                 
            }, 
            tooltipTitles: function (type, page, current) {
				//如果想要去掉页码数字上面的预览功能，则在此操作。例如：可以直接return。
                switch (type) {
		            case "first":
		                return "Go to first page";
		            case "prev":
		                return "Go to previous page";
		            case "next":
		                return "Go to next page";
		            case "last":
		                return "Go to last page";
		            case "page":
		                return (page === current) ? "Current page is " + page : "Go to page " + page;
		        }
            },
            onPageClicked: function (e, originalEvent, type, page) {  
                 //单击当前页码触发的事件。若需要与后台发生交互事件可在此通过ajax操作。page为目标页数。
                 //console.log(e);
                 //console.log(originalEvent);
                // console.log(type);
            }
        };
        element.bootstrapPaginator(options);	//进行初始化
    });

</script>
</body>
</html>